<script language="javascript" type="text/javascript">
	$(function()
	{
		var now = new Date();
		now.setDate(now.getDate()-5);
		$('.date-pick').datePicker(
			{
				altFormat: "yy-mm-dd",
				startDate: now,
				endDate: ""				
			}			
		);		
	});
	
</script>
<script language="javascript" type="text/javascript" src="/js/script.js"></script>
<form name="frmAddEvent" method="POST" action="">
	<table border="0" width="95%" cellpadding="1" cellspacing="2" style="line-height: 35px;">
		<tr>
			<td colspan="4" align="left" style="line-height: 25px;"><h4 class="title">Add Events</h4></td>
		</tr>
		<tr>
			<td align="left" width="30%">Customer</td>
			<td colspan="3" width="70%" align="left">
				<select name="cmbCustomer" id="cmbCustomer">
					<option value="">Select Customer</option>
					<?php
						foreach ($this->cust_arr as $cust_entry) :
					?>
						<option value="<?php echo $cust_entry['customer_id']; ?>"><?php echo $cust_entry['customer_name']; ?></option>
					<?php
						endforeach;
					?>
				</select>
			</td>
		</tr>
		<tr>
			<td align="left">Date</td>
			<td align="left" colspan="3"><input name="date1" id="date1" class="date-pick" readonly="readonly" /></td>			
		</tr>
		<tr>
			<td align="left" colspan="2" style="padding: 15px 0 10px 0;"><b><h3>Activities</h3></b></td>			
		</tr>
		<tr>
			<td align="center" valign="top"><?php echo $this->curr_user_fname; ?>&nbsp;<?php echo $this->curr_user_lname; ?></td>
			<td align="left" colspan="3">
				<textarea name="user_activity" id="user_activity" rows="3" cols="65"></textarea>				
			</td>
		</tr>
		<tr>
			<td align="left" colspan="4" style="padding: 15px 0 10px 0;"><h3>Do you want to add more users to this event?&nbsp;<input type="checkbox" name="chkShowEle" id="chkShowEle" value="" onclick="showEle('show_users')" /></h3></td>			
		</tr>
		<tr id="show_users" style="display: none;">
			<td align="left" valign="top">Members</td>
			<td align="left" colspan="3" style="padding: 50px 0 0 0;">
				<table width="100%" border="0" cellpadding="1" cellspacing="2">
				<?php
					$i = 1;
					foreach ($this->user_arr as $key=>$user_entry) :
						if($i == 1)
						{
							echo "<tr>";
						}
				?>
					<td style="line-height: 30px;">
									<input type="checkbox" name="chkMultipleUsers[]" id="chkMultipleUsers<?php echo $user_entry['userid']; ?>" value="<?php echo $user_entry['userid']; ?>" onclick="addActivityUsers(<?php echo $user_entry['userid']; ?>, <?php echo count($this->user_arr); ?>);" />&nbsp;<?php echo $user_entry['first_name']; ?>&nbsp;<?php echo $user_entry['last_name']; ?>(<?php echo $user_entry['userlevel']; ?>)&nbsp; <div id="completed" style="display: none;float: left; position: absolute; left: 480px; top: 470px;"></div>
									<div id="div_users<?php echo $user_entry['userid']; ?>" style="display: none;"><textarea name="user_activity[]" id="user_activity_<?php echo $user_entry['userid']; ?>" rows="3" cols="65" onblur="addSubTmpUser(<?php echo $this->curr_userid; ?>, <?php echo $user_entry['userid']; ?>, 'add', '')"></textarea><input type="hidden" name="txtUserId[]" id="txtUserId<?php echo $user_entry['userid']; ?>" value="<?php echo $user_entry['userid']; ?>" /></div>
									
					</td>						
				<?php
					endforeach;			
				?>			
				</table>
			</td>			
		</tr>
		<tr>
			<td align="left">Time Chargeble</td>
			<td align="left" colspan="3"><input type="radio" name="txtTimeChargeble" id="txtTimeChargeble" value="1" />Yes&nbsp;<input type="radio" name="txtTimeChargeble" id="txtTimeChargeble" value="0" />No</td>
		</tr>
		<tr>
			<td align="left">Transport Chargeble</td>
			<td align="left" colspan="3"><input type="radio" name="txtTransportChargeble" id="txtTransportChargeble" value="1" />Yes&nbsp;<input type="radio" name="txtTransportChargeble" id="txtTransportChargeble" value="0" />No</td>
		</tr>
		<tr>
			<td align="left">Service Agreement</td>
			<td align="left" colspan="3"><input type="radio" name="txtServiceAgreement" id="txtServiceAgreement" value="1" />Yes&nbsp;<input type="radio" name="txtServiceAgreement" id="txtServiceAgreement" value="0" />No</td>
		</tr>
		<tr>
			<td align="left" valign="top">Additional Text</td>
			<td align="left" colspan="3"><textarea name="additional_text" id="additional_text" rows="3" cols="65"></textarea></td>
		</tr>
		<tr>
			<td align="left">Start Time:</td>
			<td align="left" colspan="3" valign="middle">
				<div id="sample2">
					<!--<input type="text" name="s2Time1" id="s2Time1" class="inp-form" style="width: 70px;" value="" readonly="readonly" />-->
					<select name="cmbSthr" id="cmbSthr" style="width: 70px;">
						<option value="#">Hours</option>
						<?php
							for ($i = 1; $i <= 12; $i++)
							{
								if($i < 10) {
									$i = "0" . $i;
								}
						?>
								<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
						<?php
							}
						?>		
					</select> - 
					<select name="cmbStmin" id="cmbStmin" style="width: 80px;">
						<option value="#">Minutes</option>
						<?php
							for ($i = 0; $i < 60; $i=$i+5 )
							{
								if($i < 10) {
									$i = "0" . $i;
								} else if($i == 0)
								{
									$i = "00";
								}
								
						?>
								<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
						<?php
							}
						?>		
					</select> -
					<select name="timeAbbr" id="timeSAbbr" style="width: 50px;">
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select>
				</div>
			</td>
		</tr>
		<tr>
			<td align="left">End Time:</td>
			<td align="left" colspan="3" valign="middle">
				<div id="sample2">
					<!--<input type="text" name="s2Time2" id="s2Time2" class="inp-form" style="width: 70px;" value="" readonly="readonly" />-->
					<select name="cmbEndhr" id="cmbEndhr" style="width: 70px;">
						<option value="#">Hours</option>
						<?php
							for ($i = 1; $i <= 12; $i++)
							{
								if($i < 10) {
									$i = "0" . $i;
								}
						?>
								<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
						<?php
							}
						?>		
					</select> - 
					<select name="cmbEndmin" id="cmbEndmin" style="width: 80px;">
						<option value="#">Minutes</option>
						<?php
							for ($i = 0; $i < 60; $i=$i+5 )
							{
								if($i < 10) {
									$i = "0" . $i;
								} else if($i == 0)
								{
									$i = "00";
								}
								
						?>
								<option value="<?php echo $i; ?>"><?php echo $i; ?></option>
						<?php
							}
						?>		
					</select> -
					<select name="timeAbbr" id="timeEAbbr" style="width: 50px;">
						<option value="AM">AM</option>
						<option value="PM">PM</option>
					</select>									
				</div>
			</td>
		</tr>
		<tr>
			<td align="left">Event Type</td>
			<td align="left" colspan="3">
				<select name="eventtype" id="eventtype">
					<option value="">Select Event</option>
					<option value="visit">Customer Visit</option>
					<option value="call">On Call</option>
				</select>
			</td>
		</tr>
		<tr>
			<td align="left" colspan="4">
				<div style="padding: 30px 0 0 0;" class="edit-icoset">
					<a id="addevent" title="" href="javascript: void(0);" onclick="addEvent()"><img alt="" src="/images/icons/save-2.gif">Add Event</a>
				</div>	
			</td>
					
		</tr>
	</table>
</form>